<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, maximum-scale=1, user-scalable=0, user-scalable=no">
<title>{$title}</title>
	<script src="{CURR_UI_DIR}jq/jquery-2.2.3.js"></script>
    <script src="{CURR_UI_DIR}jq/jquery-2.2.3.min.js"></script>
    <script src="{CURR_UI_DIR}weui/weui.js"></script>
    
    <link rel="stylesheet" href="{CURR_UI_DIR}weui/style/weui.css"/>
     
    {php // echo register_jssdk()}
  
</head>

<style>
.page_title {
    font-size: 1.4rem;
    color: #F96A0E;
}
.weui_media_box .weui_media_title {
    color: #F96A0E;
}

.page_top_item {
    text-align: center;
}
.page_top_item span{
    width: 20%;
    line-height: 25px;
    border-radius: 3px;
    border: 1px solid #ff5f27;
    margin-top: 7px;
    text-align: center;
    color: #ff5f27;	
    display: inline-block;	
}
.font_activity {
    background: #ff5f27!important;
    color: #fff!important;
}

</style>

    
<body ontouchstart><section>
 <style type="text/css">
    body,html{height:100%;-webkit-tap-highlight-color:transparent}.page,body{background-color:#fbf9fe}.page{overflow-y:auto;-webkit-overflow-scrolling:touch}
</style> 

	<div class="page_top_item">
        <a href="{php echo $this->createmobileUrl('index', array('show' => 'notify'));}"><span {if !$_GPC['show'] || $_GPC['show']=='notify'}class="font_activity"{/if}>通知记录</span></a>
        <a href="{php echo $this->createmobileUrl('record', array('show' => 'record'));}"><span {if $_GPC['show']=='record'}class="font_activity"{/if}>留言记录</span></a>
        <a href="{php echo $this->createmobileUrl('record', array('show' => 'record_add'));}"><span {if $_GPC['show']=='record_add'}class="font_activity"{/if}>我要留言</span></a>
	</div>

<div class="weui_dialog_alert" id="dialog2" style="display: none;">
    <div class="weui_mask"></div>
    <div class="weui_dialog">
        <div class="weui_dialog_hd"><strong class="weui_dialog_title">弹窗标题</strong></div>
        <div class="weui_dialog_bd">弹窗内容，告知当前页面信息等</div>
        <div class="weui_dialog_ft">
            <a id="ok1" href="javascript:;" class="weui_btn_dialog primary">确定</a>
        </div>
    </div>
</div> 

    <div class="weui_panel">
        {if $show == 'record_add'}    
       
<style>
.page_title {
    font-size: 1.4rem;
    color: #F96A0E;
}
.weui_media_box .weui_media_title {
    color: #F96A0E;
}
.weui_btn_primary2 {
    background-color: #E85C06;
}
.page_title {
    font-size: 1.4rem;
    color: #E85C06;
}
.page_title {
    text-align: center;
    font-size: 34px;
    color: #E85C06;
    font-weight: 400;
    margin: 0 15%;
}
.help-block img {
	width: 90%;
}
</style>        
        	    <div class="hd" style="padding:0">
                    <h1 class="page_title">添加新留言</h1>
                </div>  
                {template 'common/header'}  
        		<form action="{php echo $this->createmobileUrl('record');}" method="post" name="utask_submit" enctype="multipart/form-data">
                <input type="hidden" name="token" value="{$_W['token']}" />
                <input type="hidden" name="op" value="record_submit">
                <div class="weui_panel_bd">
                        <div class="weui_media_box weui_media_text">
                            <p class="weui_media_desc" style="display:block">   
                            图片：
    	{if $staff_photo}
        	<img src="{$staff_photo}" width="80%">
        {/if}
                  <div class="weui_uploader">
                        <div class="weui_uploader_bd">
                          <ul class="weui_uploader_files"><!-- 预览图插入到这 --> </ul>
                          <div class="weui_uploader_input_wrp"><input class="weui_uploader_input js_file" type="file" accept="image/jpg,image/jpeg,image/png,image/gif" ></div>
                        </div>
                  </div>                            
                            <br />
                            文本：<textarea placeholder="留言内容" cols="40" rows="4" id="rcd_txt" name="rcd_txt"></textarea>
                            
                            </p>
        
                        </div>                          
                </div>
                <div style="margin-bottom:20px;">                
                    <div class="weui_opr_area">
                        <p class="weui_btn_area">
                            <a href="javascript:;" onClick="form_submit()" class="weui_btn weui_btn_primary2">提 交</a>
                        </p>
                    </div>                             
                </div>                       
                    <script>
                    function form_submit() {
                        if ($('#rcd_txt').val() == '') {
                            alert('请填写留言内容！');
                            return false;
                        }
                        document.utask_submit.submit()
                    }
                    </script>                        
                </form>   
				<script>var widgets_ajax_pic_host = "{php echo $this->createMobileUrl('AjaxUploadPic');}";</script>                
                <script src="{CURR_UI_DIR}jq/q_3354988381_ajax_pic.js"></script>                
        {/if}
         
        {if $show == 'record'}  
				<div class="weui_panel">
                    <div class="weui_panel_bd">
                        {loop $notify_arr $data}
                            <div class="weui_media_box weui_media_text">
                                <h4 class="weui_media_title">{$data['rcd_txt']}</h4>
                                {if $data['rcd_pic']}
                                <p class="weui_media_desc" style="display:block">
                                    <img src="{php echo $_W['attachurl'] . $data['rcd_pic'];}" width="80%">                   
                                </p>
                                {/if}
                                {if $data['reply_txt']}
								<p class="weui_media_desc" style="display:block">
                                    回复信息：{php echo htmlspecialchars_decode($data['reply_txt']);}                   
                                </p>    
								<p class="weui_media_desc" style="display:block">
                                    回复时间：{$data['reply_time']}                 
                                </p>                                                             
                                {/if}
                                <ul class="weui_media_info">
                                    <li class="weui_media_info_meta">{$data['create_time']}</li>
                                </ul>
                            </div>            
                        {/loop}
                        {if empty($notify_arr)}
                            <div class="weui_media_box weui_media_text">
                                <h4 class="weui_media_title">暂无新留</h4>
                            </div>       
                        {/if}        
                        
                        
                    </div>
                 </div>                
        {/if}
        
        {if $show == 'notify'}  
        <div class="weui_panel_bd"> 
            {if $status == -2}
                <div class="msg">
                    <div class="weui_msg">
                        <div class="weui_icon_area"><i class="weui_icon_safe weui_icon_safe_warn"></i></div>
                        <div class="weui_text_area">
                            <h2 class="weui_msg_title">尚未申请</h2>
                        </div>
                        <div class="weui_opr_area">
                            <p class="weui_btn_area">
                                <a href="javascript:;" id="bt_apply" class="weui_btn weui_btn_primary">申请开通通知服务</a>
                            </p>
                        </div>
                        <div class="weui_extra_area">{$_W['page']['footer']}</div>
                    </div>
                </div>  
            <form action="" method="post" id="form_apply" name="form_apply">
                <input type="hidden" name="token" value="{$_W['token']}" />
                <input type="submit" name="submit" id="bt_submit" style="display:none" value="1">
            </form>
            <script>
            $(function(){ 
                $("#bt_apply").click(function(){ 
                    $('#bt_submit').click();
                });
            });
            </script>          
            {else if $status == -1}
                <div class="msg">
                    <div class="weui_msg">
                        <div class="weui_icon_area"><i class="weui_icon_msg weui_icon_warn"></i></div>
                        <div class="weui_text_area">
                            <h2 class="weui_msg_title">审核失败</h2>
                        </div>
                        <div class="weui_extra_area">{$_W['page']['footer']}</div>
                    </div>
                </div>
            {else if $status == 0}
                <div class="msg">
                    <div class="weui_msg">
                        <div class="weui_icon_area"><i class="weui_icon_msg weui_icon_waiting"></i></div>
                        <div class="weui_text_area">
                            <h2 class="weui_msg_title">审核中</h2>
                        </div>
                        <div class="weui_extra_area">{$_W['page']['footer']}</div>
                    </div>
                </div>       
            {else if $status == 1}                
                <div class="weui_panel">
                    <div class="weui_panel_bd">
                        {loop $notify_arr $data}
                            <div class="weui_media_box weui_media_text">
                                <h4 class="weui_media_title">{$data['type_name']}</h4>
                                <p class="weui_media_desc" style="display:block">
                                    {if $data['type']=='T'}
                                        <?php 
                                        $tpl_row = $this->get_template_list($data['tpl_id']);
            
                            if ($tpl_row['caption']) {
                                echo '<span style="color:'.$tpl_row['captioncolor'].'">' . $tpl_row['caption'] . '</span><br><br>';
                            }                 
            
                            for ($i=1; $i<=10; $i++) {
                                $name = 'keyword' . $i;
                                if ($tpl_row[$name]) {
                                    echo $tpl_row[$name . 'code'] . '：<span style="color:'.$tpl_row[$name . 'color'].'">' . $tpl_row[$name] . '</span><br>';
                                }
                            }      
                                   
                           
                            if ($tpl_row['linkurl']) {
                                echo '<br><a href="'.$tpl_row['linkurl'].'">详情</a><br>';
                            }                             
                                        ?>
                                    {else}
                                        {php echo str_replace(chr(13).chr(10), '<br>', $data['content_arr']['content']);}
                                    {/if}                    
                                </p>
                                <ul class="weui_media_info">
                                    <li class="weui_media_info_meta">{$data['create_at']}</li>
                                </ul>
                            </div>            
                        {/loop}
                        {if empty($notify_arr)}
                            <div class="weui_media_box weui_media_text">
                                <h4 class="weui_media_title">暂无通知</h4>
                            </div>       
                        {/if}        
                        
                        
                    </div>
                 </div>   
            {/if}
        </div>    
        {/if}
		
    </div>

</section>     
</body>
</html>
